//
//  SPHttpClient.h
//  Sport
//
//  Created by Cass on 2018/4/3.
//  Copyright © 2018年 Cass. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger,SPHttpMethod) {
    SPHttpMethodGet,
    SPHttpMethodPost,
    SPHttpMethodUpload
};

typedef void(^successBlock)(id responseObject);
typedef void(^failureBlock)(NSError *error);
typedef void(^progressBlock)(float progress);

@interface SPHttpClient : NSObject

+ (void)GET:(NSString *)URLString
 parameters:(id)parameters
    success:(successBlock)successBlock
    failure:(failureBlock)failureBlock;

+ (void)POST:(NSString *)URLString
  parameters:(id)parameters
     success:(successBlock)successBlock
     failure:(failureBlock)failureBlock;

+ (void)UPLOAD:(NSString *)URLString
    parameters:(id)parameters
    fileData:(NSData *)fileData
      progress:(progressBlock)progressBlock
       success:(successBlock)successBlock
       failure:(failureBlock)failureBlock;

@end
